.class public Lcom/xingbook/ui/WindmillView;
.super Landroid/view/View;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field private a:Landroid/graphics/Bitmap;

.field private b:Landroid/graphics/Bitmap;

.field private c:Landroid/graphics/Bitmap;

.field private d:[Landroid/graphics/Bitmap;

.field private e:[F

.field private f:F

.field private g:F

.field private h:Landroid/graphics/Matrix;

.field private i:Landroid/graphics/Matrix;

.field private j:F

.field private k:F

.field private l:F

.field private m:F

.field private n:F

.field private o:F

.field private p:F

.field private q:Z

.field private r:Z

.field private s:Lcom/xingbook/ui/y;

.field private t:Landroid/content/res/AssetFileDescriptor;

.field private u:Landroid/graphics/Paint;

.field private v:Z

.field private w:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1

    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    const/4 v0, -0x1

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    return-void
.end method

.method private a(FF)I
    .locals 12

    const/4 v3, -0x1

    const-wide/high16 v10, 0x4000

    const-wide v6, 0x401921fb54442d18L

    float-to-double v0, p2

    float-to-double v4, p1

    invoke-static {v0, v1, v4, v5}, Ljava/lang/Math;->atan2(DD)D

    move-result-wide v0

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->f:F

    float-to-double v4, v2

    sub-double/2addr v0, v4

    const-wide v4, 0x3fd921fb54442d18L

    add-double/2addr v0, v4

    const-wide v4, -0x3fe6de04abbbd2e8L

    cmpg-double v2, v0, v4

    if-gez v2, :cond_2

    const-wide v4, 0x402921fb54442d18L

    add-double/2addr v0, v4

    :cond_0
    :goto_0
    div-double/2addr v0, v6

    const-wide/high16 v4, 0x4020

    mul-double/2addr v0, v4

    invoke-static {v0, v1}, Ljava/lang/Math;->floor(D)D

    move-result-wide v0

    double-to-int v2, v0

    if-ltz v2, :cond_1

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->e:[F

    array-length v0, v0

    if-lt v2, v0, :cond_4

    :cond_1
    move v0, v3

    :goto_1
    return v0

    :cond_2
    const-wide/16 v4, 0x0

    cmpg-double v2, v0, v4

    if-gez v2, :cond_3

    add-double/2addr v0, v6

    goto :goto_0

    :cond_3
    cmpl-double v2, v0, v6

    if-ltz v2, :cond_0

    sub-double/2addr v0, v6

    goto :goto_0

    :cond_4
    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->e:[F

    aget v0, v0, v2

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->f:F

    add-float/2addr v0, v1

    float-to-double v0, v0

    cmpl-double v4, v0, v6

    if-lez v4, :cond_5

    sub-double/2addr v0, v6

    :cond_5
    float-to-double v4, p1

    iget v6, p0, Lcom/xingbook/ui/WindmillView;->j:F

    float-to-double v6, v6

    invoke-static {v0, v1}, Ljava/lang/Math;->cos(D)D

    move-result-wide v8

    mul-double/2addr v6, v8

    sub-double/2addr v4, v6

    invoke-static {v4, v5, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v4

    float-to-double v6, p2

    iget v8, p0, Lcom/xingbook/ui/WindmillView;->j:F

    float-to-double v8, v8

    invoke-static {v0, v1}, Ljava/lang/Math;->sin(D)D

    move-result-wide v0

    mul-double/2addr v0, v8

    sub-double v0, v6, v0

    invoke-static {v0, v1, v10, v11}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v0

    add-double/2addr v0, v4

    invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v0

    iget v4, p0, Lcom/xingbook/ui/WindmillView;->k:F

    float-to-double v4, v4

    cmpg-double v0, v0, v4

    if-gtz v0, :cond_6

    move v0, v2

    goto :goto_1

    :cond_6
    move v0, v3

    goto :goto_1
.end method

.method private a()V
    .locals 7

    iget-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->q:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    if-nez v0, :cond_0

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x7f060001

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->openRawResourceFd(I)Landroid/content/res/AssetFileDescriptor;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    :cond_0
    invoke-static {}, Lcom/xingbook/c/a;->a()Lcom/xingbook/c/a;

    move-result-object v0

    iget-object v1, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    invoke-virtual {v1}, Landroid/content/res/AssetFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;

    move-result-object v1

    iget-object v2, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    invoke-virtual {v2}, Landroid/content/res/AssetFileDescriptor;->getStartOffset()J

    move-result-wide v2

    iget-object v4, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    invoke-virtual {v4}, Landroid/content/res/AssetFileDescriptor;->getLength()J

    move-result-wide v4

    const/4 v6, 0x1

    invoke-virtual/range {v0 .. v6}, Lcom/xingbook/c/a;->a(Ljava/io/FileDescriptor;JJZ)V

    :cond_1
    :goto_0
    return-void

    :cond_2
    invoke-static {}, Lcom/xingbook/c/a;->a()Lcom/xingbook/c/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/a;->b()V

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    if-eqz v0, :cond_1

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;

    invoke-virtual {v0}, Landroid/content/res/AssetFileDescriptor;->close()V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->t:Landroid/content/res/AssetFileDescriptor;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0
.end method

.method private declared-synchronized b()Z
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->q:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method


# virtual methods
.method public a(FLcom/xingbook/ui/y;)V
    .locals 9

    const/16 v8, 0x8

    const/4 v1, 0x0

    const/high16 v7, 0x4000

    iput-object p2, p0, Lcom/xingbook/ui/WindmillView;->s:Lcom/xingbook/ui/y;

    new-array v2, v8, [I

    fill-array-data v2, :array_0

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    const v0, 0x7f020227

    invoke-static {v3, v0}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->a:Landroid/graphics/Bitmap;

    const v0, 0x7f020225

    invoke-static {v3, v0}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->b:Landroid/graphics/Bitmap;

    const v0, 0x7f020226

    invoke-static {v3, v0}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->c:Landroid/graphics/Bitmap;

    new-array v0, v8, [Landroid/graphics/Bitmap;

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->d:[Landroid/graphics/Bitmap;

    new-array v0, v8, [F

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->e:[F

    move v0, v1

    :goto_0
    if-lt v0, v8, :cond_0

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->d:[Landroid/graphics/Bitmap;

    aget-object v0, v0, v1

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    int-to-float v0, v0

    div-float/2addr v0, v7

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->k:F

    div-float v0, p1, v7

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->m:F

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->l:F

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->l:F

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->k:F

    sub-float/2addr v0, v2

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->j:F

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->a:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    int-to-float v0, v0

    sub-float v0, p1, v0

    div-float/2addr v0, v7

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->n:F

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->b:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    int-to-float v0, v0

    div-float/2addr v0, v7

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->o:F

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->b:Landroid/graphics/Bitmap;

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v0

    int-to-float v0, v0

    div-float/2addr v0, v7

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->p:F

    new-instance v0, Landroid/graphics/Matrix;

    invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->h:Landroid/graphics/Matrix;

    new-instance v0, Landroid/graphics/Matrix;

    invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->i:Landroid/graphics/Matrix;

    iput-boolean v1, p0, Lcom/xingbook/ui/WindmillView;->q:Z

    iput-boolean v1, p0, Lcom/xingbook/ui/WindmillView;->r:Z

    new-instance v0, Landroid/graphics/Paint;

    const/4 v1, 0x1

    invoke-direct {v0, v1}, Landroid/graphics/Paint;-><init>(I)V

    iput-object v0, p0, Lcom/xingbook/ui/WindmillView;->u:Landroid/graphics/Paint;

    new-instance v0, Ljava/lang/Thread;

    invoke-direct {v0, p0}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void

    :cond_0
    iget-object v4, p0, Lcom/xingbook/ui/WindmillView;->d:[Landroid/graphics/Bitmap;

    aget v5, v2, v0

    invoke-static {v3, v5}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v5

    aput-object v5, v4, v0

    iget-object v4, p0, Lcom/xingbook/ui/WindmillView;->e:[F

    const v5, 0x3f490fdb

    int-to-float v6, v0

    mul-float/2addr v5, v6

    aput v5, v4, v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    nop

    :array_0
    .array-data 0x4
        0x2t 0x2t 0x2t 0x7ft
        0x0t 0x2t 0x2t 0x7ft
        0xfdt 0x1t 0x2t 0x7ft
        0xfft 0x1t 0x2t 0x7ft
        0xfct 0x1t 0x2t 0x7ft
        0xfet 0x1t 0x2t 0x7ft
        0x1t 0x2t 0x2t 0x7ft
        0x3t 0x2t 0x2t 0x7ft
    .end array-data
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 12

    const/4 v11, 0x0

    const-wide v9, 0x401921fb54442d18L

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->h:Landroid/graphics/Matrix;

    invoke-virtual {v0}, Landroid/graphics/Matrix;->reset()V

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->h:Landroid/graphics/Matrix;

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->n:F

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->n:F

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Matrix;->setTranslate(FF)V

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->h:Landroid/graphics/Matrix;

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->g:F

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->l:F

    iget v3, p0, Lcom/xingbook/ui/WindmillView;->m:F

    invoke-virtual {v0, v1, v2, v3}, Landroid/graphics/Matrix;->postRotate(FFF)Z

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->a:Landroid/graphics/Bitmap;

    iget-object v1, p0, Lcom/xingbook/ui/WindmillView;->h:Landroid/graphics/Matrix;

    iget-object v2, p0, Lcom/xingbook/ui/WindmillView;->u:Landroid/graphics/Paint;

    invoke-virtual {p1, v0, v1, v2}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V

    const/4 v0, 0x0

    move v2, v0

    :goto_0
    const/16 v0, 0x8

    if-lt v2, v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->i:Landroid/graphics/Matrix;

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->l:F

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->o:F

    sub-float/2addr v1, v2

    iget v2, p0, Lcom/xingbook/ui/WindmillView;->m:F

    iget v3, p0, Lcom/xingbook/ui/WindmillView;->p:F

    sub-float/2addr v2, v3

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Matrix;->setTranslate(FF)V

    iget-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->c:Landroid/graphics/Bitmap;

    :goto_1
    iget-object v1, p0, Lcom/xingbook/ui/WindmillView;->i:Landroid/graphics/Matrix;

    invoke-virtual {p1, v0, v1, v11}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V

    return-void

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->e:[F

    aget v0, v0, v2

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->f:F

    add-float/2addr v0, v1

    float-to-double v0, v0

    cmpl-double v3, v0, v9

    if-lez v3, :cond_1

    sub-double/2addr v0, v9

    :cond_1
    iget-object v3, p0, Lcom/xingbook/ui/WindmillView;->i:Landroid/graphics/Matrix;

    iget v4, p0, Lcom/xingbook/ui/WindmillView;->l:F

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->j:F

    float-to-double v5, v5

    invoke-static {v0, v1}, Ljava/lang/Math;->cos(D)D

    move-result-wide v7

    mul-double/2addr v5, v7

    double-to-float v5, v5

    add-float/2addr v4, v5

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->k:F

    sub-float/2addr v4, v5

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->m:F

    iget v6, p0, Lcom/xingbook/ui/WindmillView;->j:F

    float-to-double v6, v6

    invoke-static {v0, v1}, Ljava/lang/Math;->sin(D)D

    move-result-wide v0

    mul-double/2addr v0, v6

    double-to-float v0, v0

    add-float/2addr v0, v5

    iget v1, p0, Lcom/xingbook/ui/WindmillView;->k:F

    sub-float/2addr v0, v1

    invoke-virtual {v3, v4, v0}, Landroid/graphics/Matrix;->setTranslate(FF)V

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->d:[Landroid/graphics/Bitmap;

    aget-object v0, v0, v2

    iget-object v1, p0, Lcom/xingbook/ui/WindmillView;->i:Landroid/graphics/Matrix;

    invoke-virtual {p1, v0, v1, v11}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V

    add-int/lit8 v0, v2, 0x1

    move v2, v0

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->b:Landroid/graphics/Bitmap;

    goto :goto_1
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 7

    const/4 v6, -0x1

    const/4 v0, 0x0

    const/4 v1, 0x1

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I

    move-result v2

    if-eq v2, v1, :cond_1

    :cond_0
    :goto_0
    return v1

    :cond_1
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v2

    iget v3, p0, Lcom/xingbook/ui/WindmillView;->l:F

    sub-float/2addr v2, v3

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v3

    iget v4, p0, Lcom/xingbook/ui/WindmillView;->m:F

    sub-float/2addr v3, v4

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v4

    if-nez v4, :cond_3

    invoke-static {v2}, Ljava/lang/Math;->abs(F)F

    move-result v4

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->o:F

    cmpg-float v4, v4, v5

    if-gtz v4, :cond_2

    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v4

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->p:F

    cmpg-float v4, v4, v5

    if-gtz v4, :cond_2

    iput-boolean v1, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->invalidate()V

    goto :goto_0

    :cond_2
    invoke-direct {p0, v2, v3}, Lcom/xingbook/ui/WindmillView;->a(FF)I

    move-result v2

    iput v2, p0, Lcom/xingbook/ui/WindmillView;->w:I

    if-le v2, v6, :cond_b

    invoke-virtual {p0, v0}, Lcom/xingbook/ui/WindmillView;->setRunning(Z)V

    goto :goto_0

    :cond_3
    if-ne v4, v1, :cond_9

    invoke-static {v2}, Ljava/lang/Math;->abs(F)F

    move-result v4

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->o:F

    cmpg-float v4, v4, v5

    if-gtz v4, :cond_5

    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v4

    iget v5, p0, Lcom/xingbook/ui/WindmillView;->p:F

    cmpg-float v4, v4, v5

    if-gtz v4, :cond_5

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    iget-boolean v2, p0, Lcom/xingbook/ui/WindmillView;->r:Z

    if-eqz v2, :cond_4

    :goto_1
    invoke-virtual {p0, v0}, Lcom/xingbook/ui/WindmillView;->setPaused(Z)V

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->invalidate()V

    goto :goto_0

    :cond_4
    move v0, v1

    goto :goto_1

    :cond_5
    iget-boolean v4, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    if-eqz v4, :cond_6

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->invalidate()V

    :cond_6
    invoke-direct {p0, v2, v3}, Lcom/xingbook/ui/WindmillView;->a(FF)I

    move-result v2

    if-le v2, v6, :cond_8

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    if-le v0, v6, :cond_7

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    if-ne v0, v2, :cond_7

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->s:Lcom/xingbook/ui/y;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/WindmillView;->s:Lcom/xingbook/ui/y;

    invoke-interface {v0, v2}, Lcom/xingbook/ui/y;->a(I)V

    goto :goto_0

    :cond_7
    invoke-virtual {p0, v1}, Lcom/xingbook/ui/WindmillView;->setRunning(Z)V

    goto/16 :goto_0

    :cond_8
    iget v2, p0, Lcom/xingbook/ui/WindmillView;->w:I

    if-le v2, v6, :cond_b

    invoke-virtual {p0, v1}, Lcom/xingbook/ui/WindmillView;->setRunning(Z)V

    goto/16 :goto_0

    :cond_9
    const/4 v2, 0x3

    if-ne v4, v2, :cond_a

    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->v:Z

    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->invalidate()V

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->w:I

    if-le v0, v6, :cond_0

    invoke-virtual {p0, v1}, Lcom/xingbook/ui/WindmillView;->setRunning(Z)V

    goto/16 :goto_0

    :cond_a
    const/4 v2, 0x2

    if-eq v4, v2, :cond_0

    :cond_b
    move v1, v0

    goto/16 :goto_0
.end method

.method public declared-synchronized run()V
    .locals 5

    const/high16 v4, 0x43b4

    const-wide v2, 0x401921fb54442d18L

    monitor-enter p0

    :goto_0
    :try_start_0
    invoke-direct {p0}, Lcom/xingbook/ui/WindmillView;->b()Z

    move-result v0

    if-eqz v0, :cond_2

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    const v1, 0x3bab92a6

    add-float/2addr v0, v1

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->g:F

    const v1, 0x3e99999a

    add-float/2addr v0, v1

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->g:F

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    float-to-double v0, v0

    cmpl-double v0, v0, v2

    if-ltz v0, :cond_0

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    float-to-double v0, v0

    sub-double/2addr v0, v2

    double-to-float v0, v0

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->f:F

    :cond_0
    iget v0, p0, Lcom/xingbook/ui/WindmillView;->g:F

    cmpl-float v0, v0, v4

    if-ltz v0, :cond_1

    iget v0, p0, Lcom/xingbook/ui/WindmillView;->g:F

    sub-float/2addr v0, v4

    iput v0, p0, Lcom/xingbook/ui/WindmillView;->g:F

    :cond_1
    invoke-virtual {p0}, Lcom/xingbook/ui/WindmillView;->postInvalidate()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_2
    const-wide/16 v0, 0x64

    :try_start_1
    invoke-virtual {p0, v0, v1}, Ljava/lang/Object;->wait(J)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    :try_start_2
    invoke-virtual {v0}, Ljava/lang/InterruptedException;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized setPaused(Z)V
    .locals 4

    const/4 v1, 0x1

    const/4 v0, 0x0

    monitor-enter p0

    :try_start_0
    iput-boolean p1, p0, Lcom/xingbook/ui/WindmillView;->r:Z

    iget-boolean v3, p0, Lcom/xingbook/ui/WindmillView;->q:Z

    if-eqz p1, :cond_1

    move v2, v0

    :goto_0
    if-eq v3, v2, :cond_0

    if-eqz p1, :cond_2

    :goto_1
    iput-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->q:Z

    invoke-direct {p0}, Lcom/xingbook/ui/WindmillView;->a()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_0
    monitor-exit p0

    return-void

    :cond_1
    move v2, v1

    goto :goto_0

    :cond_2
    move v0, v1

    goto :goto_1

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized setRunning(Z)V
    .locals 1

    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->r:Z

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/xingbook/ui/WindmillView;->q:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-ne v0, p1, :cond_1

    :cond_0
    :goto_0
    monitor-exit p0

    return-void

    :cond_1
    :try_start_1
    iput-boolean p1, p0, Lcom/xingbook/ui/WindmillView;->q:Z

    invoke-direct {p0}, Lcom/xingbook/ui/WindmillView;->a()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method
